#ifndef GAMEOBJECT_H
#define GAMEOBJECT_H

#include "dllspec.h"

#include <map>
#include <list>

#include <SFML/System.hpp>
#include <SFML/Network.hpp>

namespace OBJECT_TYPE
{
	const sf::Uint8 SHIP = 1;
	const sf::Uint8 PLANET = 2;
	const sf::Uint8 BULLET = 3;
	const sf::Uint8 WEAPON = 4;
}

class DLL_EXPORT GameObject
{
	public:
		GameObject() : id(0), parent(0), lifespan(0.0f), weaponCooldown(0.0f), controls(0) { };

		sf::Uint32 id;
		sf::Uint32 parent;
		sf::Uint8 type;
		sf::Vector2f pos;
		sf::Vector2f vel;
		sf::Vector2f acc;

		float angle;
		float angVel;
		float mass;
		float size;
		float lifespan;

		float weaponCooldown;

		sf::Uint8 controls;

	private:
};

DLL_EXPORT sf::Packet& operator <<(sf::Packet& Packet, const GameObject& obj);
DLL_EXPORT sf::Packet& operator >>(sf::Packet& Packet, GameObject& obj);

typedef std::map<sf::Uint32, GameObject*> GameObjectMap;
typedef GameObjectMap::iterator GameObjectMapIT;
typedef std::list<GameObject*> GameObjectList;
typedef GameObjectList::iterator GameObjectListIT;

#endif // GAMEOBJECT_H
